<template>
  <view class="container screen-width">
    <view class="content">
      <view class="name">{{ form.title }}</view>
      <!-- <view class="content-info" v-html="form.synopsis"></view> -->
      <view class="content-info">
        <text>{{ form.synopsis }}</text>
      </view>
      <view class="time">活动时间：{{ form.beginDate }}到{{ form.endDate }}</view>
    </view>
    <view class="form-box">
      <view class="item">
        <view class="flex items-middle lable-info">
          <view class="must">*</view>
          <view class="lable">公司名称</view>
        </view>
        <input 
          @blur="chandleClick('blur')"
          @focus="chandleClick('focus')" 
          placeholder="请输入公司名称"
          v-model="form.companyName"/>
      </view>
      <view class="item">
        <view class="flex items-middle lable-info">
          <view class="must">*</view>
          <view class="lable">姓名</view>
        </view>
        <input placeholder="请输入姓名" v-model="form.userName" />
      </view>
      <view class="item">
        <view class="flex items-middle lable-info">
          <view class="must">*</view>
          <view class="lable">手机号码</view>
        </view>
        <input placeholder="请输入手机号码" v-model="form.phoneNumber" />
      </view>
      <view v-if="form.type === '1'" class="item">
        <view class="flex items-middle lable-info">
          <view class="lable">职位</view>
        </view>
        <input placeholder="请输入职位" v-model="form.position" />
      </view>
      <view v-if="form.type === '1'" class="item">
        <view class="flex items-middle lable-info">
          <view class="lable">公司简介</view>
        </view>
        <input placeholder="请输入公司简介" v-model="form.companySynopsis" />
      </view>
      <view class="btn" @click="submitForm">{{ form.type == '1' ? '报名' : '签到' }} </view>

      <view v-if="companyNameList.length && form.companyName && showList" class="search_result">
        <view class="result-list">
          <view v-for="(item, index) in companyNameList" :key="index" class="result-item" @tap="selectItem(item.companyName, item.companyId)">
            <view v-html="item.companyName"></view>
          </view>
        </view>
      </view>
    </view>

    <u-popup v-model="showtips" mode="bottom" @close="onClose">
      <view class="flex items-middle space-between" style="padding: 20px;box-sizing: border-box;">
        <text style="font-size: 12px;">您是否要跳转小程序填写信息,体验更好。</text>
        <template>
          <wx-open-launch-weapp id="launch-btn" appid="wxa702cd88beea7973" :path="`pages/activity/Index?type=${form.type}&id=${form.activityId}`">
            <script type="text/wxtag-template">
              <style>
                .collect { 
                  font-size: 12px;
                  justify-content: space-around;
                  align-items: center;
                  display: flex;
                  flex-direction: column;
                  width: 60px;
                  height: 30px; 
                  line-height: 30px;
                  background: #dddddd;
                  text-algin: center;
                  border-radius: 50px;
                }
                .text-tongxun{
                  font-size: 12px;
                  color: #1678ff;
                }
              </style>
              <view class="collect">
                <view class="text-tongxun">跳转</view>
              </view>
            </script>
          </wx-open-launch-weapp>
        </template>
      </view>
    </u-popup>
  </view>
</template>

<script src="./index.js"></script>
<style lang="less" scoped src="./index.less"></style>
